home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 533 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: chronicle.mti.sgi.com!austern
  2. From: jason@cygnus.com (Jason Merrill)
  3. Newsgroups: comp.std.c++
  4. Subject: template names
  5. Date: 16 Feb 1996 15:10:56 PST
  6. Organization: Cygnus Support, Mountain View, CA
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <u991i2q34m.fsf@yorick.cygnus.com>
  9. NNTP-Posting-Host: isolde.mti.sgi.com
  10. X-Original-Date: 16 Feb 1996 15:09:29 -0800
  11. X-Newsreader: Gnus v5.0
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBVAwUBMSUPGUy4NqrwXLNJAQGZUQH+IOqJu1fvoYF9wa7xwvSpCTDHaJ9ziOSK
  14.     VeazDUPEmAfdCQC2AODDXWyNzqhpq9MMwWZwExhwmXfOkiqEj7AAag==
  15.     =jcCD
  16. Originator: austern@isolde.mti.sgi.com
  17.  
  18. Does this passage:
  19.  
  20.   14.2.1  Locally declared names                            [temp.local]
  21.  
  22. 1 Within the scope of a class template or a specialization of a template
  23.   the  name  of  the  template is equivalent to the name of the template
  24.   followed by the template-parameters enclosed  in  <>.   [Example:  the
  25.   constructor  for Set can be referred to as Set() or Set<T>().  ]
  26.  
  27. make this testcase well-formed?
  28.  
  29. template <class T> struct A {};
  30. template <class T> struct B
  31.   : public A<B>         // use of B without parms
  32. { A* ap; };             // use of A without parms
  33.  
  34. How about this?
  35.  
  36. template <class T> struct A {
  37.   A::A::A* p;
  38. };
  39.  
  40. What is "the scope of a class template"?  Judging from
  41.  
  42.   9   Classes                                          [class]
  43.  
  44. 2 A  class-name is inserted into the scope in which it is declared imme-
  45.   diately after the class-name is seen.  The class-name is also inserted
  46.   into  the scope of the class itself.  For purposes of access checking,
  47.   the inserted class name is treated as if it were a public member name.
  48.  
  49. I would say that A<B> above is ill-formed, and the others are well-formed.
  50. Agree?
  51.  
  52. Jason
  53. ---
  54. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  55.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  56.   in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
  57.